﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace APNotifications.Dialog
{
    public partial class frmTransparency : Form
    {
        public frmTransparency()
        {
            InitializeComponent();
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            double _trackbar;
            _trackbar = (trackBar1.Value * 5);
            this.Owner.Opacity = (_trackbar / 100);            
        }

        private void frmTransparency_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (trackBar1.Value > 4)
            {
                Config.SaveTransparency(trackBar1.Value);
            }
            else
            {
                Config.SaveTransparency(4);
            }
        }

        private void frmTransparency_Load(object sender, EventArgs e)
        {
            trackBar1.Value = (Config.Transparency());
        }
    }
}
